\(\int \cos (c+d x) (a+a \sec (c+d x)) \, dx\) [6]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 15 \[ \int \cos (c+d x) (a+a \sec (c+d x)) \, dx=a x+\frac {a \sin (c+d x)}{d} \]

[Out]

a*x+a*sin(d*x+c)/d

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {3872, 2717, 8} \[ \int \cos (c+d x) (a+a \sec (c+d x)) \, dx=\frac {a \sin (c+d x)}{d}+a x \]

[In]

Int[Cos[c + d*x]*(a + a*Sec[c + d*x]),x]

[Out]

a*x + (a*Sin[c + d*x])/d

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3872

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rubi steps \begin{align*} \text {integral}& = a \int 1 \, dx+a \int \cos (c+d x) \, dx \\ & = a x+\frac {a \sin (c+d x)}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.73 \[ \int \cos (c+d x) (a+a \sec (c+d x)) \, dx=a x+\frac {a \cos (d x) \sin (c)}{d}+\frac {a \cos (c) \sin (d x)}{d} \]

[In]

Integrate[Cos[c + d*x]*(a + a*Sec[c + d*x]),x]

[Out]

a*x + (a*Cos[d*x]*Sin[c])/d + (a*Cos[c]*Sin[d*x])/d

Maple [A] (verified)

Time = 0.44 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.07

method result size
risch \(a x +\frac {a \sin \left (d x +c \right )}{d}\) \(16\)
parallelrisch \(\frac {a \left (d x +\sin \left (d x +c \right )\right )}{d}\) \(16\)
derivativedivides \(\frac {a \sin \left (d x +c \right )+a \left (d x +c \right )}{d}\) \(21\)
default \(\frac {a \sin \left (d x +c \right )+a \left (d x +c \right )}{d}\) \(21\)
norman \(\frac {a x +a x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\) \(50\)

[In]

int(cos(d*x+c)*(a+a*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

a*x+a*sin(d*x+c)/d

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.13 \[ \int \cos (c+d x) (a+a \sec (c+d x)) \, dx=\frac {a d x + a \sin \left (d x + c\right )}{d} \]

[In]

integrate(cos(d*x+c)*(a+a*sec(d*x+c)),x, algorithm="fricas")

[Out]

(a*d*x + a*sin(d*x + c))/d

Sympy [A] (verification not implemented)

Time = 0.78 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.13 \[ \int \cos (c+d x) (a+a \sec (c+d x)) \, dx=a x + a \left (\begin {cases} x \cos {\left (c \right )} & \text {for}\: d = 0 \\\frac {\sin {\left (c + d x \right )}}{d} & \text {otherwise} \end {cases}\right ) \]

[In]

integrate(cos(d*x+c)*(a+a*sec(d*x+c)),x)

[Out]

a*x + a*Piecewise((x*cos(c), Eq(d, 0)), (sin(c + d*x)/d, True))

Maxima [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.33 \[ \int \cos (c+d x) (a+a \sec (c+d x)) \, dx=\frac {{\left (d x + c\right )} a + a \sin \left (d x + c\right )}{d} \]

[In]

integrate(cos(d*x+c)*(a+a*sec(d*x+c)),x, algorithm="maxima")

[Out]

((d*x + c)*a + a*sin(d*x + c))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 39 vs. \(2 (15) = 30\).

Time = 0.28 (sec) , antiderivative size = 39, normalized size of antiderivative = 2.60 \[ \int \cos (c+d x) (a+a \sec (c+d x)) \, dx=\frac {{\left (d x + c\right )} a + \frac {2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1}}{d} \]

[In]

integrate(cos(d*x+c)*(a+a*sec(d*x+c)),x, algorithm="giac")

[Out]

((d*x + c)*a + 2*a*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 + 1))/d

Mupad [B] (verification not implemented)

Time = 13.22 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00 \[ \int \cos (c+d x) (a+a \sec (c+d x)) \, dx=a\,x+\frac {a\,\sin \left (c+d\,x\right )}{d} \]

[In]

int(cos(c + d*x)*(a + a/cos(c + d*x)),x)

[Out]

a*x + (a*sin(c + d*x))/d